package com.mjlf.thread;

/**
 * @ClassName ThreadInterupt
 * @Author mjlft
 * @Date 2019/7/7 20:32
 * @Version 1.0
 * @Description TODO
 */
public class ThreadInterupt extends Thread {

    public void run(){
        while(!Thread.currentThread().isInterrupted()){

            while (true) {
                System.out.println("-------------");
                tet();
            }
        }
    }

    public static Integer i;

    public static void tet(){
        i ++;
        i.toString();
    }

    public static void main(String[] args) {
        ThreadInterupt interupt = new ThreadInterupt();
        interupt.start();
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        interupt.interrupt();
        try {
            interupt.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
